﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GmFamilyService.h"
#include "IFamilyEntity.h"

namespace gcmp
{
    class IGraphicsLine;
    class IGraphicsPlane;
}

namespace gfam
{
    /// \brief 草图平面类
    class GM_FAMILY_SERVICE_EXPORT IFamilySketchPlane : public IFamilyEntity
    {
        DEFINE_CAST_DERIVED(gfam::IFamilySketchPlane, gfam::IFamilyEntity)

    public:

        enum EnAxisTagId
        {
            TAG_AXIS_X = 0,
            TAG_AXIS_Y = 1,
        };

        /// \brief 创建草图平面
        ///
        /// \param[in] pDoc 文档指针
        /// \param[in] coord 平面坐标系
        /// \return 如果成功，则返回草图平面指针，如果失败，则为nullptr
        static IFamilySketchPlane* Create(gcmp::IDocument* pDoc, const gcmp::Coordinate3d& coord);

        /// \brief 获取草图平面的坐标系
        ///
        /// \return 返回坐标系对象
        virtual gcmp::Coordinate3d GetPlane()const = 0;

        /// \brief 设置草图平面的坐标系
        ///
        /// \param[in] 坐标系对象
        /// \return true:设置成功；false：设置失败
        virtual bool SetPlane(const gcmp::Coordinate3d& coord) = 0;
        
        /// \brief 获取参考平面ElementId
        ///
        /// \return 返回参考平面ElementId
        virtual gcmp::ElementId GetReferencePlaneId() const = 0;
        
        /// \brief 设置参考平面ElementId
        ///
        /// \param[in] 参考平面ElementId
        /// \return true:设置成功；false:设置失败
        virtual bool SetReferencePlaneId(const gcmp::ElementId& id) = 0;

        /// \brief  设置拥有者id
        ///
        /// \param  id  拥有者id
        /// \return 设置成功返回true,否则返回false
        virtual bool SetOwnerFormId(const gcmp::ElementId& id) = 0;

        /// \brief  获取拥有者id
        ///
        /// \return 拥有者id
        virtual gcmp::ElementId GetOwnerFormId() const = 0;

        /// \brief  设置参照平面的uv
        ///
        /// \param  refUV  uv信息
        virtual void SetReferencePlaneUV(const gcmp::Vector2d &refUV) = 0;
        
        /// \brief 返回参照平面的uv
        /// 
        /// \return   uv信息
        virtual gcmp::Vector2d GetReferencePlaneUV() const = 0;

        /// \brief 设置是否反向锁定到参照平面
        ///
        /// \param isReverseLocked 是否反向锁定 
        virtual void SetIsReverseLocked(bool isReverseLocked) = 0;
        
        /// \brief 返回是否反向锁定到参照平面
        /// 
        /// \return  反向锁定返回true,否则返回false
        virtual bool GetIsReverseLocked() const = 0;

        /// \brief 获取轴线 
        /// 
        /// \param axisTag 标记id
        /// \return  轴线
        virtual const gcmp::IGraphicsLine* GetAxisLineXOrY(EnAxisTagId axisTag) const = 0;

        /// \brief 获取轴线 
        /// 
        /// \param axisTag 标记id
        /// \return  轴线
        virtual gcmp::IGraphicsLine* GetAxisLineXOrYFW(EnAxisTagId axisTag) = 0;

        /// \brief 获取草图id 
        /// 
        /// \return  草图id
        virtual gcmp::ElementId GetSketchId() const = 0;

        /// \brief 设置草图id 
        /// 
        /// \param sketchId 草图id
        /// \return  
        virtual bool SetSketchId(const gcmp::ElementId& sketchId) = 0;



        //////////////////////////// 下面的方法需要确认，先不要直接使用 ////////////////////////////////////////////////
        /// \brief 
        /// \return 
        virtual gcmp::IGraphicsPlane * GetGraphicsPlaneForSolveFW() = 0;

        /// \brief 
        /// \param[in] 
        /// \return 
        virtual void SetOldCoordinate(const gcmp::Coordinate3d& coor) = 0;

        /// \brief 
        /// \return 
        virtual gcmp::Coordinate3d GetOldCoordinate() const = 0;

        /// \brief 
        ///
        /// \return 
        virtual gcmp::ElementId GetReferenceLevelId() const = 0;

        /// \brief 
        /// \param[in] 
        /// \return 
        virtual bool SetReferenceLevelId(const gcmp::ElementId& id) = 0;

        /// \brief 
        /// \return 
        virtual double GetOffsetDistanceToReferenceLevel() const = 0;

        /// \brief 
        /// \param[in] 
        /// \return 
        virtual bool SetOffsetDistanceToReferenceLevel(double offsetDistance) = 0;

        /// \brief 
        /// \param[in] 
        /// \return 
        virtual bool SetCanBeMoved(bool bYesOrNo) = 0;

        /// \brief 
        /// \return 
        virtual bool GetCanBeMoved() const = 0;

        /// \brief 
        /// \param[in] 
        /// \return 
        virtual bool SetCanBeDeleted(bool bYesOrNo) = 0;

       
    };
}
